import { GET_INFO } from "../constant";

export const getInfo = () => (dispath:<T>(data:T)=>void) => {
    fetch('https://www.fastmock.site/mock/d61f00e3b7b40936630832c7bf1af769/api/getUser').then(async res=>{
        let r = await res.json()
        dispath({type: GET_INFO, userInfo: r})
        console.log(r)
    })
}

// export const getInfo = () => {
//     return dispath => {

//     }
// }